//
//  AppDelegate.swift
//  WeiBo
//
//  Created by LTX on 2016/10/29.
//  Copyright © 2016年 LTX. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    
    var defalutViewController : UIViewController  {
        let isLogin = UserAccountViewModel.shareIntance.isLogin

        if isLogin {
            return WelcomeViewController()
        }else{
            return MainViewController()
        }
        
    }
    

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

        //设置全局Tabbar颜色
        UITabBar.appearance().tintColor = UIColor.orange
        
        // MARK:- 设置全局navigationBar颜色
        UINavigationBar.appearance().tintColor = UIColor.orange
        
        //创建window
        
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.rootViewController = defalutViewController
        window?.makeKeyAndVisible()
        
        
        return true
    }




}

